package com.njzf.zcenter.generator;

import com.github.davidfantasy.mybatisplus.generatorui.GeneratorConfig;
import com.github.davidfantasy.mybatisplus.generatorui.MybatisPlusToolsApplication;
import com.github.davidfantasy.mybatisplus.generatorui.mbp.NameConverter;

public class GeneratorUIServer {
    public static void main(String[] args) {
        GeneratorConfig config = GeneratorConfig.builder()
                // 数据库连接地址
                .jdbcUrl("jdbc:mysql://20.20.136.153:3306/sk_test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai")
                .userName("root")
                .password("Njzf1984!(*$!!!")
                .driverClassName("com.mysql.cj.jdbc.Driver")
                .schemaName("myBusiness")
                .nameConverter(new NameConverter() {
                    @Override
                    public String serviceNameConvert(String entityName) {
                        return entityName + "Service";
                    }

                    @Override
                    public String controllerNameConvert(String entityName) {
                        return entityName + "Controller";
                    }
                })
                //包路径，根据实际工程修改
                .basePackage("com.xxx.yyy.test")
                //访问端口
                .port(9527)
                .build();
        MybatisPlusToolsApplication.run(config);
    }
}
